home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / STUTTGART / LANG / SCHEME / GNU / SCM4E1 / !Scm / slib / sc4sc3 < prev    next >
Text File  |  1991-11-30  |  571b  |  20 lines

  1. ;;;; Implementation of rev4 procedures for rev3.
  2. ;;; Copyright (C) 1991 Aubrey Jaffer.
  3.  
  4. ;;;; peek-char, number->string, and string->number need to be written here.
  5.  
  6. ;;; APPEND, +, *, -, /, =, <, >, <=, >=, MAP, and FOR-EACH need to
  7. ;;; accept more general number or arguments.
  8.  
  9. (define (list? x)
  10.   (let loop ((fast x) (slow x))
  11.     (or (null? fast)
  12.     (and (pair? fast)
  13.          (let ((fast (cdr fast)))
  14.            (or (null? fast)
  15.            (and (pair? fast) 
  16.             (let ((fast (cdr fast))
  17.                   (slow (cdr slow)))
  18.               (and (not (eq? fast slow))
  19.                    (loop fast slow))))))))))
  20.